package com.mcf.xiaolinju.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mcf.xiaolinju.vo.noticeReturn;
import com.mcf.xiaolinju.entity.Notices;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author mcf
 * @since 2021-12-02
 */
public interface NoticesMapper extends BaseMapper<Notices> {
    //修改公告
    Integer update(int id, String title, String content, LocalDate starttime, LocalDate endtime,  int userid, LocalDateTime time);
    //删除公告
    Integer del(int id,int userid, LocalDateTime time);
    //撤回
    Integer undo(int id,int userid,LocalDateTime time);
    //批量撤回
    Integer  manyundo(Integer[] id,int updateid ,LocalDateTime time);
    //分页查询
    Page<noticeReturn> selectpage(IPage<noticeReturn> page, int id,int type);
    //每天修改公告的撤回
    Integer everyupdate();

    //模糊查询
    Page<noticeReturn> selectdim(IPage<noticeReturn> page, int id, int type, String title, LocalDate date);
    //批量删除
    int manydel(Integer[] id, int updateid, LocalDateTime time);
    //查询今日的公告
    List<Notices> selectnotice(int id);
    //小程序模糊查询小区的公告
    List<Notices> selectdimnotice(int id,Integer noticetype,LocalDate datatime,String title);
}
